# Copyright (C) 2018 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
load("@io_bazel_rules_go//go:def.bzl", "go_library")
load("//tools/build:rules.bzl", "apic_template")

apic_template(
    name = "api_proto",
    api = "//gapis/api/gvr:api",
    templates = ["//gapis/api/templates:proto"],
    visibility = ["//visibility:public"],
)

go_library(
    name = "go_default_library",
    srcs = ["doc.go"],
    embed = [":gvr_pb_go_proto"],  # keep
    importpath = "github.com/google/gapid/gapis/api/gvr/gvr_pb",
    visibility = ["//visibility:public"],
)

proto_library(
    name = "gvr_pb_proto",
    srcs = [":api_proto"],  # keep
    visibility = ["//visibility:public"],
    deps = ["//gapis/memory/memory_pb:memory_pb_proto"],  # keep
)

cc_proto_library(
    name = "gvr_pb_cc_proto",
    visibility = ["//visibility:public"],
    deps = [":gvr_pb_proto"],
)

# keep
go_proto_library(
    name = "gvr_pb_go_proto",
    importpath = "github.com/google/gapid/gapis/api/gvr/gvr_pb",
    proto = ":gvr_pb_proto",
    visibility = ["//visibility:public"],
    deps = ["//gapis/memory/memory_pb:go_default_library"],
)
